<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>买家修改页面</title>
    <link rel="stylesheet" href="../js/bootstrap3/css/bootstrap.min.css">
    <link rel="stylesheet" href="../js/bootstrap-treeview/bootstrap-treeview.min.css">
    <link rel="stylesheet" href="../js/bootStrap-addTabs/bootstrap.addtabs.css">
    <link rel="stylesheet" href="../js/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="../js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="../js/bootstrap-fileinput/css/fileinput.min.css">
    <link rel="stylesheet" href="../js/kindeditor-4.1.10/themes/default/default.css"/>
</head>
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../js/bootstrap3/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-treeview/bootstrap-treeview.min.js"></script>
<script type="text/javascript" src="../js/bootStrap-addTabs/bootstrap.addtabs.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript" src="../js/bootstrap-bootbox/bootbox.js"></script>
<script type="text/javascript" src="../js/bootstrap-fileinput/js/fileinput.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-fileinput/js/locales/zh.js"></script>
<script type="text/javascript" src="../js/kindeditor-4.1.10/kindeditor-all.js"></script>
<body>

<!-- container-fluid 流式布局 -->
<div class="container-fluid">
    <form id="updateForm" class="form-horizontal">
        <input type="hidden" name="buyerid" th:value="${buyer.buyerid}"/>
        <div class="row">
            <div class="col-xs-2">姓名</div>
            <div class="col-xs-4">
                <input type="text" id="buyername" name="buyername" th:value="${buyer.buyername}" class="form-control"/>
            </div>
            <div class="col-xs-2">电话</div>
            <div class="col-xs-4">
                <input type="text" id="buyerphone" name="buyerphone" th:value="${buyer.buyerphone}" class="form-control"/>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-2">钱包</div>
            <div class="col-xs-4">
                <input type="text" id="buyerqianbao" name="buyerqianbao" th:value="${buyer.buyerqianbao}" readonly class="form-control"/>
            </div>
            <div class="col-xs-2">类型</div>
            <div class="col-xs-4">
                <!--<select name="statusid" id="statusid" th:each="s:${statusList}" class="form-control">
                    <option th:value="${s.statusid}" th:text="${s.statusname}"></option>
                </select>-->
                <select class="form-control select2" id="statusid" name="statusid">
                    <option value="-1"> -- 请选择 -- </option>
                    <option  th:selected="${buyer.status.statusid eq s.statusid}" th:each="s:${statusList}"  th:value="${s.statusid}" th:text="${s.statusname}" value="1">蔬菜</option>
                </select>
            </div>
        </div>
    </form>
</div>

</body>
<script type="text/javascript">

    //校验用户是否已存在
    $("#buyername").blur(checkName=function(){
        var nameValue = $("#buyername").val();
        if(nameValue==null || nameValue==''){
            alert("用户名不能为空！");
            return false;
        }
        return true;
    })
    //校验电话是否为空
    $("#buyerphone").blur(checkPhone=function(){
        var phoneValue = $("#buyerphone").val();
        if(phoneValue==null || phoneValue==''){
            alert("电话不能为空！");
            return false;
        }
        return true;
    })
    //校验是否已选择状态
    $("#statusid").change(checkRole=function (){
        if($("#statusid").val()==''){
            alert("请选择状态！");
            return false;
        }
        return true;
    })


</script>
</html>